package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementSrSrtpLabelMapper;
import com.ruoyi.net.domain.ElementSrSrtpLabel;
import com.ruoyi.net.service.IElementSrSrtpLabelService;

/**
 * 网元-SR-srtp-标签线Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementSrSrtpLabelServiceImpl implements IElementSrSrtpLabelService 
{
    @Autowired
    private ElementSrSrtpLabelMapper elementSrSrtpLabelMapper;

    /**
     * 查询网元-SR-srtp-标签线
     * 
     * @param id 网元-SR-srtp-标签线主键
     * @return 网元-SR-srtp-标签线
     */
    @Override
    public ElementSrSrtpLabel selectElementSrSrtpLabelById(String id)
    {
        return elementSrSrtpLabelMapper.selectElementSrSrtpLabelById(id);
    }

    /**
     * 查询网元-SR-srtp-标签线列表
     * 
     * @param elementSrSrtpLabel 网元-SR-srtp-标签线
     * @return 网元-SR-srtp-标签线
     */
    @Override
    public List<ElementSrSrtpLabel> selectElementSrSrtpLabelList(ElementSrSrtpLabel elementSrSrtpLabel)
    {
        return elementSrSrtpLabelMapper.selectElementSrSrtpLabelList(elementSrSrtpLabel);
    }

    /**
     * 新增网元-SR-srtp-标签线
     * 
     * @param elementSrSrtpLabel 网元-SR-srtp-标签线
     * @return 结果
     */
    @Override
    public int insertElementSrSrtpLabel(ElementSrSrtpLabel elementSrSrtpLabel)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementSrSrtpLabel.getId())) {
            elementSrSrtpLabel.setId(uuid);
        }
        elementSrSrtpLabel.setCreateBy(SecurityUtils.getUsername());
        elementSrSrtpLabel.setCreateTime(DateUtils.getNowDate());
        elementSrSrtpLabel.setUpdateBy(SecurityUtils.getUsername());
        elementSrSrtpLabel.setUpdateTime(DateUtils.getNowDate());
        return elementSrSrtpLabelMapper.insertElementSrSrtpLabel(elementSrSrtpLabel);
    }

    /**
     * 修改网元-SR-srtp-标签线
     * 
     * @param elementSrSrtpLabel 网元-SR-srtp-标签线
     * @return 结果
     */
    @Override
    public int updateElementSrSrtpLabel(ElementSrSrtpLabel elementSrSrtpLabel)
    {
        elementSrSrtpLabel.setUpdateBy(SecurityUtils.getUsername());
        elementSrSrtpLabel.setUpdateTime(DateUtils.getNowDate());
        return elementSrSrtpLabelMapper.updateElementSrSrtpLabel(elementSrSrtpLabel);
    }

    /**
     * 批量删除网元-SR-srtp-标签线
     * 
     * @param ids 需要删除的网元-SR-srtp-标签线主键
     * @return 结果
     */
    @Override
    public int deleteElementSrSrtpLabelByIds(String[] ids)
    {
        return elementSrSrtpLabelMapper.deleteElementSrSrtpLabelByIds(ids);
    }

    /**
     * 删除网元-SR-srtp-标签线信息
     * 
     * @param id 网元-SR-srtp-标签线主键
     * @return 结果
     */
    @Override
    public int deleteElementSrSrtpLabelById(String id)
    {
        return elementSrSrtpLabelMapper.deleteElementSrSrtpLabelById(id);
    }
}
